Imports CacheMyWork

Public Class uiOptions

#Region " Variables "

    Dim _MainForm As New CacheMyWork.UserConfiguration

#End Region

#Region " Private Methods "

    Private Sub Options_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' As the form is loaded, we populate the settings with their currently-stored values

        If UserConfiguration.DisplayNonVisibleWindows Then
            Me.uiDisplayInvisibleWindows.Checked = True

        Else : Me.uiDisplayInvisibleWindows.Checked = False
        End If

        If UserConfiguration.RestoreExplorerWindows Then
            Me.uiRestoreExplorerWindows.Checked = True

        Else : Me.uiRestoreExplorerWindows.Checked = False
        End If

    End Sub

    Private Sub uiDisplayInvisibleWindows_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiDisplayInvisibleWindows.CheckedChanged
        ' When the checkbox is checked, the user is indicating that they also want the application to list those apps without visible Windows
        If Me.uiDisplayInvisibleWindows.Checked Then
            ' Toggle the assembly-wide variable that instructs the application to show non-visible Windows apps at next instantiation of this app
            UserConfiguration.displayNonVisibleWindowsValue = True

        Else : UserConfiguration.displayNonVisibleWindowsValue = False

        End If
    End Sub

    Private Sub uiOKButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiOKButton.Click
        Me.Close()
    End Sub

    Private Sub uiRestoreExplorerWindows_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiRestoreExplorerWindows.CheckedChanged
        ' When the checkbox is checked, the user is indicating that they want the application to configure Explorer's setting "restore previous folder windows at next logon"
        If Me.uiRestoreExplorerWindows.Checked Then
            ' Toggle the assembly-wide variable that configures Explorer's setting "restore previous folder windows at next logon"
            UserConfiguration.RestoreExplorerWindows = True

        Else : UserConfiguration.RestoreExplorerWindows = False

        End If

    End Sub

#End Region

End Class